home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 April: Mac OS SDK / Dev.CD Apr 98 SDK1.toast / Development Kits (Disc 1) / Macintosh Drag and Drop / Demo Applications / Dragster / DragText Sources / globals.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-01-03  |  1.7 KB  |  93 lines  |  [TEXT/KAHL]

  1. /*
  2.  *
  3.  *        globals.h
  4.  *
  5.  *        Global variables and constants.
  6.  *        
  7.  *
  8.  *        Author:        Rob Johnston
  9.  *        Date:        Monday, January 20, 1992
  10.  *
  11.  *        12/30/94    JML        Code now compiles with Universal interfaces.
  12.  *
  13.  *        Copyright © 1992 Apple Computer, Inc.
  14.  *
  15.  */
  16.  
  17. #include <Windows.h>
  18. #include <TextEdit.h>
  19.  
  20. /*
  21.  *    Window Constants.
  22.  */
  23.  
  24. #define    MaxDocumentCount        8
  25.  
  26. #define    InitialH                16
  27. #define    InitialV                42
  28.  
  29. #define    TopMargin                6
  30. #define    LeftMargin                6
  31. #define    RightMargin                6
  32. #define    BottomMargin            6
  33.  
  34. #define    ScrollResolution        12
  35.  
  36.  
  37. /*
  38.  *    File Constants.
  39.  */
  40.  
  41. #define    FileCreator                'dNet'
  42. #define    FileType                'TEXT'
  43.  
  44.  
  45. /*
  46.  *    Data Structures.
  47.  */
  48.  
  49. typedef struct Document {
  50.     WindowPtr        theWindow;
  51.     TEHandle        theTE;
  52.     short            docTop;
  53.     RgnHandle        hiliteRgn;
  54.     ControlHandle    vScroll, hScroll;
  55.     short            vScrollPos;
  56.     short            fRefNum;
  57.     short            dirty;
  58.     Handle            undoDragText;
  59.     short            undoSelStart, undoSelEnd;
  60.     short            lastSelStart, lastSelEnd;
  61. } Document;
  62.  
  63.  
  64. /*
  65.  *    Global Variables.
  66.  *
  67.  *    If the flag _AllocateGlobals_ is defined then "extern" is defined as NULL.
  68.  *    This makes the following definitions actually declare the variables,
  69.  *    otherwise, the variables are declared as extern. This scheme allows all
  70.  *    files to include this file to gain access to the program's global variables
  71.  *    and also allows the main.c file to define them.
  72.  */
  73.  
  74. #ifdef    _AllocateGlobals_
  75. #define    extern
  76. #endif
  77.  
  78.  
  79. extern    short            gQuit, gQuitting;
  80. extern    short            gDocumentCount;
  81. extern    Document        *gDocumentList[MaxDocumentCount];
  82. extern    short            gFontItem, gSizeItem;
  83. extern    short            gInBackground;
  84. extern    Document        *gFrontDocument;
  85. extern    short            gCanUndoDrag;
  86. extern    WindowPtr        gUndoFrontmost, gLastFrontmost;
  87.  
  88.  
  89. #ifdef    _AllocateGlobals_
  90. #undef    extern
  91. #endif
  92.  
  93.